package com.cloud.api.domain.user;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.*;
import lombok.Data;

import java.io.Serializable;
@Data
@Schema(description = "添加管理端用户请求")
public class AddUserRequest implements Serializable {

    @Schema(description = "userid")
    private String userId;

    @Schema(description = "账号")
    @NotEmpty(message = "{validation.user.username}")
    @Pattern(regexp = "^[A-Za-z0-9]{5,20}$",message = "{validation.user.username.pattern}")
    private String userName;

    @Schema(description = "状态")
    @NotNull(message = "{validation.user.enable}")
    private Integer enable;

    @Schema(description = "姓名")
    @NotEmpty(message = "{validation.user.name}")
    @Size(max = 8,message = "{validation.user.name.length}")
    private String name;

    @Schema(description = "角色")
    @NotEmpty(message = "{validation.user.roleCode}")
    private String roleCode;

    @Schema(description = "组织机构")
    @NotEmpty(message = "{validation.user.deptId}")
    private String deptId;

    @Schema(description = "邮箱")
    @Email(message = "{validation.user.email}")
    private String email;

    @Schema(description = "手机号")
    @NotEmpty(message = "{validation.common.phone}")
    @Pattern(regexp = "^1(3|4|5|6|7|8|9)\\d{9}$",message = "{validation.common.phoneFormat}")
    private String mobile;

    /*@Schema(description = "数据权限")
    @NotEmpty(message = "{validation.user.deptCode}")
    private String deptCode;*/

}
